<#assign base=request.contextPath>
<!DOCTYPE html> 
<html>
	<head>
		<title></title>
		<meta charset="utf-8">
		<#include "common/reference.ftl"/>
		<#include "common/ligerui.ftl"/>
		<script type="text/javascript">
		<!--
			
			var ligerTable = null;
			$(function(){
				ligerTable = $('#table').ligerGrid({
					width:'98%',
					enabledSort:false,
					pageSizeOptions:[5,10,20,50,100,200],
					height:'auto',
					alternatingRow:true,
					url:'${base}/complaint/getList',
					pageSize:20,
					columns:[
						{display:'投诉单号',name:'complaintNo',id:'complaintNo',align:'center'},
						{display:'投诉人',name:'complainant',id:'complainant',align:'center'},
						{display:'订单号',name:'orderNo',id:'orderNo',align:'center'},
						{display:'投诉内容',name:'content',id:'content',align:'center'},
						{
							display:'投诉时间',
							name:'time',
							id:'time',
							align:'center',
							render:function(row){
								var time = row.time * 1000;
								return formatDate(time);
							}
						},
						{
							display:'状态',
							name:'status',
							id:'status',
							align:'center',
							render:function(row){
								var status = row.status;
								if((status & 1) == 1){
									return '待处理';
								}
								else if((status & 2) == 2){
									return '已处理';
								}
								return '-';
							}
						}
						/*
						,
						{
							display:'操 作',
							align:'center',
							render:function(row){
								//申请和审核中
								if(row.status == 1){
									var applyId = row.complaintNo;
									return [ 
											'<a class="edit" href="javascript:void(0)" onclick="audit('+applyId+')"  title="审核">',
								                '<i class="fa fa-check-square-o"></i>',
								                '审核',
								            '</a>'
								            ].join('');
								}
								else{
									return '-';
								}
							}
						}
						*/
					]
				});
		        
				
				$('#btnSearch').click(function(){
					if(ligerTable){
						var startTime = $('#txtStartTime').val();
						var endTime = $('#txtEndTime').val();
						var phoneNo = $('#txtPhoneNo').val();
						ligerTable.setParm('startTime',startTime);
						ligerTable.setParm('endTime',endTime);
						ligerTable.setParm('phoneNo',phoneNo);
						ligerTable.reload();
					}
				});
				$('.date-picker').datepicker({autoclose:true});
			});
		-->
		</script>		
	</head>
	<body>
		<#include "common/breadcrumb.ftl">
		<div class="widget-box">
			<div class="widget-header">
				<h5 class="lighter">查询</h5>
			</div>
			<div class="widget-body">
				<div class="widget-main">
					<div class="row">
						<div class="col-sm-1">
							<label>开始时间</label>
						</div>
						<div class="col-sm-3">
							<div class="input-group">
								<input class="form-control date-picker" id="txtStartTime" type="text" value="${startTime}" data-date-format="yyyy-mm-dd" />
								<span class="input-group-addon">
									<i class="fa fa-calendar"></i>
								</span>
							</div>
						</div>
						<div class="col-sm-1">
							<label>截至时间</label>
						</div>
						<div class="col-sm-3">
							<div class="input-group">
								<input class="form-control date-picker" id="txtEndTime" type="text" value="${endTime}" data-date-format="yyyy-mm-dd" />
								<span class="input-group-addon">
									<i class="fa fa-calendar"></i>
								</span>
							</div>
						</div>
					</div>
					<div class="space-4"></div>
					<div class="row">
						<div class="col-sm-8">
							<div class="input-group">
								<input id="txtPhoneNo" type="text" class="form-control search-query" placeholder="请输手机号" />
								<span class="input-group-btn">
									<button id="btnSearch" type="button" class="btn btn-purple btn-sm">
										查询
										<i class="icon-search icon-on-right bigger-110"></i>
									</button>
								</span>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<div class="widget-box">
			<div class="widget-header">
				<h5 class="lighter">
					<i class="icon-table"></i>
					投诉记录列表
				</h5>
			</div>
			<div class="widget-body">
				<div id="table"><div>
			</div>
		</div>
	</body>
</html>